package com.eb.buybuybuy.controller;

import com.eb.buybuybuy.annotation.*;
import com.eb.buybuybuy.bean.Goods;
import com.eb.buybuybuy.constant.RequestMethodConstant;
import com.eb.buybuybuy.constant.RequestMethodEnum;
import com.eb.buybuybuy.core.IOC;
import com.eb.buybuybuy.result.Result;
import com.eb.buybuybuy.service.GoodsService;
import com.eb.buybuybuy.service.impl.GoodsServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Component
@HttpController("/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;

    @Entrance(path = "/info", method = RequestMethodEnum.GET)
    public Object info(@RequestParameter("id") String id) throws Exception {
        return goodsService.info(Integer.valueOf(id));
    }

    @Entrance(path = "/list", method = RequestMethodEnum.GET)
    public Object list() throws Exception {
        return goodsService.list();
    }
}
